<?php

class TruckBuilder implements BuilderInterface {

    private $truck;
    /**
     * @return mixed
     */
    public function createVehicle()
    {
        $this->truck = new Truck();
    }

    /**
     * @return mixed
     */
    public function addWheel()
    {
        $this->truck->setPart('wheel1', new Wheel());
    }

    /**
     * @return mixed
     */
    public function addEngine()
    {
        $this->truck->setPart('truckEngine', new Engine());
    }

    /**
     * @return mixed
     */
    public function addDoors()
    {
        $this->truck->setPart('rightDoor', new Door());
        $this->truck->setPart('leftDoor', new Door());
    }

    /**
     * @return mixed
     */
    public function getVehicle()
    {
        return $this->truck;
    }
}